<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"> 
<meta content="yes" name="apple-mobile-web-app-capable">
<meta content="black" name="apple-mobile-web-app-status-bar-style">
<meta content="telephone=no" name="format-detection">
<title>修改密码</title>
<link href="${base}/templates/${config.theme}/mobile/static/css/layout.min.css" rel="stylesheet" type="text/css" />
<link href="${base}/templates/${config.theme}/mobile/static/css/common.min.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="${base}/templates/${config.theme}/mobile/static/js/jquery.js"></script>
<script type="text/javascript" src="${base}/templates/${config.theme}/mobile/static/js/jquery.cookie.js"></script>
<script type="text/javascript" src="${base}/templates/${config.theme}/mobile/static/js/ajax.js"></script>
<style type="text/css">
  .connerbox dd span.form_td {margin-left:65px;}
  .tips {color:#da4f49; text-align:center; font-weight:bold;display:none;}
</style>
</head>
<body>
<header id="header" class="header clearfix">

    <div class="head_left fl"><a href="javascript:history.back(-1);"><span class="h_back"></span></a></div>
     <span class="headtit">修改密码</span>
    <div class="head_right fr"><a href="${base}/"><span class="h_home"></span></a></div>
</header>
<div style="line-height:44px; height:44px; width:100%"></div>
 <div class="connerdiv" id="account-div">
    <form id="inputForm" action="${base}/member/password/update" method="post">
	    <dl class="connerbox">
	        <dd><span class="form_hd">当前密码：</span><span class="form_td"><input name="currentPassword" id="currentPassword" type="password" value="" maxlength="50" placeholder="6－20位字母、数字结合" class="text_input"></span></dd>
	      	<dd><span class="form_hd">密码：</span><span class="form_td"><input name="password" id="password" type="password" value="" maxlength="50" placeholder="6－20位字母、数字结合" class="text_input"></span></dd>
	      	<dd><span class="form_hd">确认密码：</span><span class="form_td ml80"><input name="rePassword" id="rePassword" type="password" value="" maxlength="50" placeholder="6－20位字母、数字结合" class="text_input"></span></dd>
	    </dl>
		<dl id="tips1" style="color:#da4f49; text-align:center; font-weight:bold;"></dl>
    	<div class="space15"></div>
    	<input name="btnReg" type="submit" class="btn_red largerbtn longbtn" value="提交">
    	<div class="space15"></div>
	</form>
</div>
<div class="space10"></div>
<script type="text/javascript">
 $(document).ready(function() {
	 $('#inputForm').submit(function() {
		if($('#currentPassword').val() == ''){
            $('#inputForm #tips1').html('请输入当前密码！');
            return false;
        }
	    if($('#password').val() == ''){
	        $('#inputForm #tips1').html('请输入密码！');
	        return false;
	    }
	    if($('#rePassword').val() != $('#password').val()){
	        $('#inputForm #tips1').html('两次输入密码不一致，请重新输入！');
	        return false;
	    }
	   //ajax
        $.ax("${base}/member/password/update",
        		$('#inputForm').serialize(),'POST',null,'json',
                function(data){
                     if(data.type=="success"){
                    	 location.href="${base}/member";
                     }else{
                    	 alert(data.content);
                     }
                },
                function(data){
                    console.dir(data);
            });
	    
	    return false;
	}); 
 });
 </script>
 </body>
 </html>